package com.nightsoul.groovy;

public class AssignmentMixed {

	public static void main(def args){
		def x=1;
		if(x==2) {
			assert false;
		}
		
		/*if(x=2) {
			println x;//Not allowed! Compiler error
		}*/
		
		if((x=3)) {
			println x;//Asign and test in nested expression
		}
		assert x==3;
		
		def store = [];
		while(x = x-1) {
			store << x;
		}
		assert store == [2, 1];
		
		while(x=1) {
			println x;
			break;//Ouch, this will print it
		}
	}
	
}
